<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户登录</title>
 <link rel="stylesheet" href="css/login.css">
   
</head>
<body>
    <div class="auth-box">
        <h2 class="auth-title">用户登录</h2>
        
        <form>
            <div class="form-group username">
                <label>用户名</label>
                <input type="text" class="input-field" placeholder="请输入用户名">
                <div class="error-msg">用户名不能为空</div>
            </div>

            <div class="form-group password">
                <label>密码</label>
                <input type="password" class="input-field" placeholder="请输入密码">
                <div class="error-msg">密码不能为空</div>
            </div>

            <button type="submit" class="auth-btn">立即登录</button>

            <div class="auth-links">
                <a href="register.html">没有账号？立即注册</a>
                <a href="index.html">返回首页</a>
            </div>
        </form>
    </div>
    <script>
document.querySelector('form').addEventListener('submit', function(e) {
  e.preventDefault();
  
  // 伪代码：这里应添加实际登录验证
  const isValid = true; // 假设验证通过
  
  if(isValid) {
    // 跳转回来源页面或首页
   
    window.location.href =   'index.html';
  }
});
</script>
</body>
</html>